/**
 * File Name   : ToLeftPageAction.java
 * Description : 
 */
package com.hh.admin.left.action;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.Logger;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.springframework.web.struts.ActionSupport;

import com.hh.admin.left.form.ResultProductTypeBean;
import com.hh.admin.left.service.ToLeftPageService;

/**
 * 打开后台管理界面时，左侧部分数据项的显示需要动态获取。
 * 该Action用于获取这些动态数据项。
 * 
 * @author 冯昌硕
 * @create 2013-1-3 上午12:26:27
 */
public class ToLeftPageAction extends ActionSupport {

    private static final Logger log = Logger.getLogger(ToLeftPageAction.class);
    
    private ToLeftPageService toLeftPageService;
    
    public ActionForward execute(ActionMapping mapping, ActionForm form,
            HttpServletRequest request, HttpServletResponse response)
            throws Exception {
        
        // 查询当前可用的产品类型信息
        List<ResultProductTypeBean> productTypeLst = toLeftPageService.getProductTypeInfoLst();
        request.setAttribute("productTypeLst", productTypeLst);
        
        return mapping.findForward("left");
    }

    public void setToLeftPageService(ToLeftPageService toLeftPageService) {
        this.toLeftPageService = toLeftPageService;
    }
}
